/**
 * 
 */
package org.gov.vis.data.gui;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.gov.vis.components.VISTextField;
import org.gov.vis.data.gui.listener.DistributionLNListener;
import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;
import org.gov.vis.util.DBConstants;

import com.toedter.calendar.JDateChooser;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
/**
 * @author Vishwanath
 *
 */
public class DistributionLNDialog extends VisBaseDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 17977616032899902L;
	private JPanel pnlDLNPanel;
	private JLabel lblVehicalNo;
	private JButton btnReset;
	private JButton btnSave;
	private JPanel btnDLNPanel;
	private VISTextField txtFldDLNEvoporation;
	private JLabel lblEvoporation;
	private VISTextField txtFldDLNVehicalNo;
	private VISTextField txtFldDLNFromStation;
	private VISTextField txtFldCode;
	private JLabel lblCode;
	private JPanel pnlMessages;
	private JLabel lblFromStation;
	private VISTextField txtFldDLNConvertedLtrs;
	private JLabel lblConvetedLtrs;
	private VISTextField txtFldDLNKgs;
	private JLabel lblKgs;
	private VISTextField txtFldDLNDODistribution;
	private JLabel lblDateOfDistribution;
	private JDateChooser dtChoDateOfDistribution;

	/**
	 * @param owner
	 * @param title
	 * @param modal
	 */
	public DistributionLNDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		// TODO Auto-generated constructor stub
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(500, 450);
		setBounds(cords.getX(), cords.getY(), 500, 450);		
	}

	private void initGUI() {
		// TODO Auto-generated method stub
		GridBagLayout thisLayout = new GridBagLayout();
		thisLayout.rowWeights = new double[] {0.1};
		thisLayout.rowHeights = new int[] {7};
		thisLayout.columnWeights = new double[] {0.1};
		thisLayout.columnWidths = new int[] {7};
		getContentPane().setLayout(thisLayout);
		{
			pnlDLNPanel = new JPanel();
			GridBagLayout pnlDLNPanelLayout = new GridBagLayout();
			pnlDLNPanelLayout.columnWidths = new int[] {7, 7, 7, 7};
			pnlDLNPanelLayout.rowHeights = new int[] {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
			pnlDLNPanelLayout.columnWeights = new double[] {0.0, 0.0, 0.1, 0.0};
			pnlDLNPanelLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
			getContentPane().add(pnlDLNPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			pnlDLNPanel.setLayout(pnlDLNPanelLayout);
			{
				lblDateOfDistribution = new JLabel();
				pnlDLNPanel.add(lblDateOfDistribution, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblDateOfDistribution.setText(setFieldLabel(getResources().getString("dialog_label_ai_code"), true));
			}
			//{
				//txtFldDLNDODistribution = new VISTextField();
				//pnlDLNPanel.add(txtFldDLNDODistribution, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			//}
			{
				lblKgs = new JLabel();
				pnlDLNPanel.add(lblKgs, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblKgs.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_kgs"), false));
			}
			{
				txtFldDLNKgs = new VISTextField();
				pnlDLNPanel.add(txtFldDLNKgs, new GridBagConstraints(2, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
				//txtFldDLNKgs.addActionListener(new DistributionLNListener(this));
				txtFldDLNKgs.addFocusListener(new DistributionLNListener(this));
			}
			{
				dtChoDateOfDistribution = new JDateChooser(null,DBConstants.DISPLAY_DATE_FORMAT);
				dtChoDateOfDistribution.setPreferredSize(txtFldDLNKgs.getPreferredSize());
				pnlDLNPanel.add(dtChoDateOfDistribution, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
		
			}
			{
				lblConvetedLtrs = new JLabel();
				pnlDLNPanel.add(lblConvetedLtrs, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblConvetedLtrs.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_cvtdltrs"), false));
			}
			{
				txtFldDLNConvertedLtrs = new VISTextField();
				pnlDLNPanel.add(txtFldDLNConvertedLtrs, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
				txtFldDLNConvertedLtrs.setEditable(false);
			}
			{
				lblFromStation = new JLabel();
				pnlDLNPanel.add(lblFromStation, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblFromStation.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_frmstation"), true));
			}
			{
				txtFldDLNFromStation = new VISTextField();
				pnlDLNPanel.add(txtFldDLNFromStation, new GridBagConstraints(2, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblVehicalNo = new JLabel();
				pnlDLNPanel.add(lblVehicalNo, new GridBagConstraints(1, 12, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblVehicalNo.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_vehiceno"), true));
			}
			{
				txtFldDLNVehicalNo = new VISTextField();
				pnlDLNPanel.add(txtFldDLNVehicalNo, new GridBagConstraints(2, 12, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblEvoporation = new JLabel();
				pnlDLNPanel.add(lblEvoporation, new GridBagConstraints(1, 14, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblEvoporation.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_evoploss"), false));
			}
			{
				txtFldDLNEvoporation = new VISTextField();
				pnlDLNPanel.add(txtFldDLNEvoporation, new GridBagConstraints(2, 14, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				btnDLNPanel = new JPanel();
				pnlDLNPanel.add(btnDLNPanel, new GridBagConstraints(2, 16, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				{
					pnlMessages = new JPanel();
					GridBagLayout jPanel1Layout = new GridBagLayout();
					pnlDLNPanel.add(pnlMessages, new GridBagConstraints(1, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					jPanel1Layout.rowWeights = new double[] {0.1};
					jPanel1Layout.rowHeights = new int[] {7};
					jPanel1Layout.columnWeights = new double[] {0.1};
					jPanel1Layout.columnWidths = new int[] {7};
					pnlMessages.setLayout(jPanel1Layout);
				}
				{
					lblCode = new JLabel();
					pnlDLNPanel.add(lblCode, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					lblCode.setText(setFieldLabel(getResources().getString("dialog_label_dist_ln_code"), true));
				}
				{
					txtFldCode = new VISTextField();
					pnlDLNPanel.add(txtFldCode, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
				}
				{
					btnSave = new JButton();
					btnDLNPanel.add(btnSave);
					btnSave.setText(getResources().getString("dialog_button_save"));
					btnSave.addActionListener(new DistributionLNListener(this));
				}
				{
					btnReset = new JButton();
					btnDLNPanel.add(btnReset);
					btnReset.setText(getResources().getString("dialog_button_reset"));
					btnReset.addActionListener(new DistributionLNListener(this));
				}
			}
		}
		this.setSize(500, 450);
	}

	public JPanel getjPanel1() {
		return pnlMessages;
	}


	/**
	 * @return the pnlDLNPanel
	 */
	public JPanel getPnlDLNPanel() {
		return pnlDLNPanel;
	}

	/**
	 * @param pnlDLNPanel the pnlDLNPanel to set
	 */
	public void setPnlDLNPanel(JPanel pnlDLNPanel) {
		this.pnlDLNPanel = pnlDLNPanel;
	}

	/**
	 * @return the lblVehicalNo
	 */
	public JLabel getLblVehicalNo() {
		return lblVehicalNo;
	}

	/**
	 * @param lblVehicalNo the lblVehicalNo to set
	 */
	public void setLblVehicalNo(JLabel lblVehicalNo) {
		this.lblVehicalNo = lblVehicalNo;
	}

	/**
	 * @return the btnReset
	 */
	public JButton getBtnReset() {
		return btnReset;
	}

	/**
	 * @param btnReset the btnReset to set
	 */
	public void setBtnReset(JButton btnReset) {
		this.btnReset = btnReset;
	}

	/**
	 * @return the btnSave
	 */
	public JButton getBtnSave() {
		return btnSave;
	}

	/**
	 * @param btnSave the btnSave to set
	 */
	public void setBtnSave(JButton btnSave) {
		this.btnSave = btnSave;
	}

	/**
	 * @return the btnDLNPanel
	 */
	public JPanel getBtnDLNPanel() {
		return btnDLNPanel;
	}

	/**
	 * @param btnDLNPanel the btnDLNPanel to set
	 */
	public void setBtnDLNPanel(JPanel btnDLNPanel) {
		this.btnDLNPanel = btnDLNPanel;
	}

	/**
	 * @return the txtFldDLNEvoporation
	 */
	public VISTextField getTxtFldDLNEvoporation() {
		return txtFldDLNEvoporation;
	}

	/**
	 * @param txtFldDLNEvoporation the txtFldDLNEvoporation to set
	 */
	public void setTxtFldDLNEvoporation(VISTextField txtFldDLNEvoporation) {
		this.txtFldDLNEvoporation = txtFldDLNEvoporation;
	}

	/**
	 * @return the lblEvoporation
	 */
	public JLabel getLblEvoporation() {
		return lblEvoporation;
	}

	/**
	 * @param lblEvoporation the lblEvoporation to set
	 */
	public void setLblEvoporation(JLabel lblEvoporation) {
		this.lblEvoporation = lblEvoporation;
	}

	/**
	 * @return the txtFldDLNVehicalNo
	 */
	public VISTextField getTxtFldDLNVehicalNo() {
		return txtFldDLNVehicalNo;
	}

	/**
	 * @param txtFldDLNVehicalNo the txtFldDLNVehicalNo to set
	 */
	public void setTxtFldDLNVehicalNo(VISTextField txtFldDLNVehicalNo) {
		this.txtFldDLNVehicalNo = txtFldDLNVehicalNo;
	}

	/**
	 * @return the txtFldDLNFromStation
	 */
	public VISTextField getTxtFldDLNFromStation() {
		return txtFldDLNFromStation;
	}

	/**
	 * @param txtFldDLNFromStation the txtFldDLNFromStation to set
	 */
	public void setTxtFldDLNFromStation(VISTextField txtFldDLNFromStation) {
		this.txtFldDLNFromStation = txtFldDLNFromStation;
	}

	/**
	 * @return the lblFromStation
	 */
	public JLabel getLblFromStation() {
		return lblFromStation;
	}

	/**
	 * @param lblFromStation the lblFromStation to set
	 */
	public void setLblFromStation(JLabel lblFromStation) {
		this.lblFromStation = lblFromStation;
	}

	/**
	 * @return the txtFldDLNConvertedLtrs
	 */
	public VISTextField getTxtFldDLNConvertedLtrs() {
		return txtFldDLNConvertedLtrs;
	}

	/**
	 * @param txtFldDLNConvertedLtrs the txtFldDLNConvertedLtrs to set
	 */
	public void setTxtFldDLNConvertedLtrs(VISTextField txtFldDLNConvertedLtrs) {
		this.txtFldDLNConvertedLtrs = txtFldDLNConvertedLtrs;
	}

	/**
	 * @return the lblConvetedLtrs
	 */
	public JLabel getLblConvetedLtrs() {
		return lblConvetedLtrs;
	}

	/**
	 * @param lblConvetedLtrs the lblConvetedLtrs to set
	 */
	public void setLblConvetedLtrs(JLabel lblConvetedLtrs) {
		this.lblConvetedLtrs = lblConvetedLtrs;
	}

	/**
	 * @return the txtFldDLNKgs
	 */
	public VISTextField getTxtFldDLNKgs() {
		return txtFldDLNKgs;
	}

	/**
	 * @param txtFldDLNKgs the txtFldDLNKgs to set
	 */
	public void setTxtFldDLNKgs(VISTextField txtFldDLNKgs) {
		this.txtFldDLNKgs = txtFldDLNKgs;
	}

	/**
	 * @return the lblKgs
	 */
	public JLabel getLblKgs() {
		return lblKgs;
	}

	/**
	 * @param lblKgs the lblKgs to set
	 */
	public void setLblKgs(JLabel lblKgs) {
		this.lblKgs = lblKgs;
	}

	/**
	 * @return the txtFldDLNDODistribution
	 */
	public VISTextField getTxtFldDLNDODistribution() {
		return txtFldDLNDODistribution;
	}

	/**
	 * @param txtFldDLNDODistribution the txtFldDLNDODistribution to set
	 */
	public void setTxtFldDLNDODistribution(VISTextField txtFldDLNDODistribution) {
		this.txtFldDLNDODistribution = txtFldDLNDODistribution;
	}

	/**
	 * @return the lblDateOfDistribution
	 */
	public JLabel getLblDateOfDistribution() {
		return lblDateOfDistribution;
	}

	/**
	 * @param lblDateOfDistribution the lblDateOfDistribution to set
	 */
	public void setLblDateOfDistribution(JLabel lblDateOfDistribution) {
		this.lblDateOfDistribution = lblDateOfDistribution;
	}

	/**
	 * @return the dtChoDateOfDistribution
	 */
	public JDateChooser getDtChoDateOfDistribution() {
		return dtChoDateOfDistribution;
	}

	/**
	 * @param dtChoDateOfDistribution the dtChoDateOfDistribution to set
	 */
	public void setDtChoDateOfDistribution(JDateChooser dtChoDateOfDistribution) {
		this.dtChoDateOfDistribution = dtChoDateOfDistribution;
	}

	/**
	 * @return the txtFldCode
	 */
	public VISTextField getTxtFldCode() {
		return txtFldCode;
	}

	/**
	 * @param txtFldCode the txtFldCode to set
	 */
	public void setTxtFldCode(VISTextField txtFldCode) {
		this.txtFldCode = txtFldCode;
	}

	/**
	 * @return the lblCode
	 */
	public JLabel getLblCode() {
		return lblCode;
	}

	/**
	 * @param lblCode the lblCode to set
	 */
	public void setLblCode(JLabel lblCode) {
		this.lblCode = lblCode;
	}

}
